package cn.com.b2office.struts2.action;

import java.util.Map;

import org.apache.struts2.interceptor.SessionAware;

import cn.com.b2office.domain.Cart;
import cn.com.b2office.domain.User;

import com.opensymphony.xwork2.ActionSupport;

public class LogoutAction extends ActionSupport implements SessionAware {

	private static final long serialVersionUID = 8227901014114158593L;

	private Map session = null;

	public void setSession(Map session) {
		this.session = session;
	}

	public String execute() throws Exception {
		User user = (User) session.get("user");
		if (user != null)
			session.remove("user");
		Cart cart = (Cart) session.get("cart");
		if (cart != null)
			session.remove("cart");
		return SUCCESS;
	}

}
